<template>
  <div>
    <el-dialog :visible.sync="show" title="预览二维码">
      <canvas ref="canvas" />
    </el-dialog>
  </div>
</template>

<script>
import QRCode from 'qrcode'
export default {

  data() {
    return {
      show: false
    }
  },
  methods: {
    // 拿到传回值渲染
    ffff(x) {
      QRCode.toCanvas(this.$refs.canvas, x, {
        while: '300'
      })
    }
  }

}
</script>

<style>

</style>
